//2009/08/20 14:36:23
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class MeasuringTemperature
{
public:
    double averageTemperature(vector <int> meas)
    {
        double sum = 0.0;
		int cnt = 0;
		for(int i=0; i<meas.size(); i++)
		{
			if(meas[i] < -273.0) continue;
			bool flag = false;
			for(int j=i-2; j<=i+2; j++)
			{
				if(i == j) continue;
				if(j>=0 && j<meas.size())
				{
					if(abs(meas[i] - meas[j]) <=2)
					{
						flag = true;
						break;
					}
				}
			}
			if(flag)
			{
				cnt ++;
				sum += meas[i];
			}
		}
		if(cnt == 0) return -300.0;
		return sum/cnt;
    }
};
